﻿@{
    ViewBag.Title = "Update";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}


@section Header
{
    <script>
        function submit() {
            //编辑器对象
            var uEditor = UE.getEditor('txt_Review');

            //验证输入
            if ($("#txt_Title").validatebox('isValid') == false) { return; }
            if ($("#txt_Reviewer").validatebox('isValid') == false) { return; }

            if (uEditor.hasContents() == false) {
                $.messager.alert('失败', '请输入内容', 'error');
                return;
            }


            //参数对象
            var review = {
                ID: $("#hid_ID").val(),
                Title: $("#txt_Title").val(),
                Reviewer: $("#txt_Reviewer").val(),
                ArtWorkReview: uEditor.getContent()
            };

            $.post("/ArtWorkReview/UpdateArtWorkReview/", review,
                    function (data, textStatus) {
                        if (data == 'success') { $.messager.alert('成功', '修改成功'); }
                        else { $.messager.alert('失败', data, 'error'); }
                    }
                  );
        }

        function goback() {
            window.location.href = "/ArtWorkReview/Edit";
        }
    </script>
}

<body>

    <div>
        @{ ArtWorkReviewInfo review = ViewBag.ArtWorkReview as ArtWorkReviewInfo;}
        @Html.Hidden("hid_ID", review.ID)
        标题:
        @Html.TextBox("txt_Title", review.Title, new { size = 50, @class = "easyui-validatebox", required = "true" })
        <br />
         评论人:
        @Html.TextBox("txt_Reviewer", review.Reviewer, new { size = 45, @class = "easyui-validatebox", required = "true" })
        <br />
        @Html.UEditor("txt_Review", review.ArtWorkReview)
        <br />
        <p>
            <input type="button" value="修改" onclick="submit()" />
            <input type="button" value="返回" onclick="goback()" />
        </p>
    </div>
</body>
